<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<title>获取Access Token</title>
<body>
  <p>把这个文件上传到你的网站再访问它</p>
  <p><a href="javascript:void(0)" onclick="window.location.href = 'https://api.wp2pcs.com/oauth_baidupcs.php?url=' + encodeURIComponent(window.location.href);">获取百度云盘Access Token</a></p>
<script>
function getArgs() {
    var args = {};
    var query = location.search.substring(1); // Get query string
    var pairs = query.split("&");
     for(var i = 0; i < pairs.length; i++) {
            var pos = pairs[i].indexOf('=');
             // Look for "name=value"
            if (pos == -1) continue;  // If not found, skip
               var argname = pairs[i].substring(0,pos); // Extract the name
               var value = pairs[i].substring(pos+1); // Extract the value
               value = decodeURIComponent(value); // Decode it, if needed
               args[argname] = value;  // Store as a property
        }
    return args; // Return the object           
}
var GET = getArgs(),
    oauth = GET['oauth'],
    access_token = GET['access_token'];
if(oauth == 'baidupcs' && access_token != '') {
  document.body.innerHTML = '<p>百度云盘的Access Token：<strong>' + access_token + '</strong></p>';
}
</script>
</body>
</html>